package hqu.cst.xah.onlinemaill.service.imp;

import hqu.cst.xah.onlinemaill.mapper.ProductMapper;
import hqu.cst.xah.onlinemaill.pojo.Product;
import hqu.cst.xah.onlinemaill.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProductServiceImp implements ProductService {

    @Autowired
    private ProductMapper productMapper;

    @Override
    public List<Product> getAllProducts() {
        return productMapper.selectList(null);
    }

    @Override
    public Product getProductById(Integer id) {
        return productMapper.selectById(id);
    }
}
